<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>审批产品拆分</title>
  </head>
  <body>
    <script type="text/javascript">
      Ext.onReady(function(){
        var separateOrderId = new Ext.form.Hidden({
          name: 'separate_order_id',
          value: '<%=params[:separate_order_id]%>'
        });
        
        var auditingStatus = new Ext.form.RadioGroup({
          //width : 220,
          fieldLabel: '是否通过',
          //hideLabel:true,
          //style:'margin-left:100px;margin-top:20px',
          columns : 2,
          anchor: '100%',
          vertical :false,
          items:[
            {boxLabel:'是',inputValue:'是',name:'auditing_status',checked:true},
            {boxLabel:'否',inputValue:'否',name:'auditing_status'}
          ]
        });

        var auditOpinion = new Ext.form.TextArea({
          fieldLabel: '审批意见',
          name: 'audit_opinion',
          allowBlank: false,
          height: 80,
          width:180
        });
        
        //提交按钮
        var separateOrderAuditButton = new Ext.Button({
          text: '提交',
          iconCls: 'icon-save',
          handler: function(){
            separateOrderAuditButton.setDisabled(true);
            if (separateOrderAuditFormPanel.form.isValid()) {
              separateOrderAuditFormPanel.form.submit({
                success: function(result, resp){
                  if (resp.result.info.indexOf("成功") >= 0) {
                    separateOrderAuditWin.destroy();
                  } else {
                    Ext.MessageBox.show({
                      title: '消息',
                      msg: resp.result.info,
                      buttons: Ext.MessageBox.OK,
                      icon: Ext.MessageBox.WARNING
                    });                    
                  }
                  separateOrderAuditButton.enable();
                },
                failure: function(result, request){
                  separateOrderAuditButton.enable();
                  Ext.MessageBox.show({
                    title: '消息',
                    msg: "通讯失败，请从新操作",
                    buttons: Ext.MessageBox.OK,
                    icon: Ext.MessageBox.WARNING
                  });
                }
              });
            }
            else {
              separateOrderAuditButton.enable();
              
            }
          }
        })
        
        var separateOrderAuditFormPanel = new Ext.form.FormPanel({
          labelWidth: 75,
          width: '290',
          labelAlign: 'right',
          frame : true,
          url: '/separate_order/updateAuditingStatus',
          method: 'GET',
          items: [separateOrderId,auditingStatus,auditOpinion],
          buttons: [separateOrderAuditButton,{
              text: '关闭',
              iconCls: 'exit',
              handler: function(){
                separateOrderAuditWin.destroy();
              }
            }]
        });
        separateOrderAuditFormPanel.render('audit_separate_order_form');
      })
    </script>
    <div id="audit_separate_order_form"></div>
  </body>
</html>
